/*
Copyright 2022 The Numaproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by Openapi Generator. DO NOT EDIT.

/// CombinedEdge : CombinedEdge is a combination of Edge and some other properties such as vertex type, partitions, limits. It's used to decorate the fromEdges and toEdges of the generated Vertex objects, so that in the vertex pod, it knows the properties of the connected vertices, for example, how many partitioned buffers I should write to, what is the write buffer length, etc.

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CombinedEdge {
    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Box<crate::models::ForwardConditions>>,
    #[serde(rename = "from")]
    pub from: String,
    #[serde(rename = "fromVertexLimits", skip_serializing_if = "Option::is_none")]
    pub from_vertex_limits: Option<Box<crate::models::VertexLimits>>,
    /// The number of partitions of the from vertex, if not provided, the default value is set to \"1\".
    #[serde(
        rename = "fromVertexPartitionCount",
        skip_serializing_if = "Option::is_none"
    )]
    pub from_vertex_partition_count: Option<i32>,
    /// From vertex type.
    #[serde(rename = "fromVertexType")]
    pub from_vertex_type: String,
    /// OnFull specifies the behaviour for the write actions when the inter step buffer is full. There are currently two options, retryUntilSuccess and discardLatest. if not provided, the default value is set to \"retryUntilSuccess\"
    #[serde(rename = "onFull", skip_serializing_if = "Option::is_none")]
    pub on_full: Option<String>,
    #[serde(rename = "to")]
    pub to: String,
    #[serde(rename = "toVertexLimits", skip_serializing_if = "Option::is_none")]
    pub to_vertex_limits: Option<Box<crate::models::VertexLimits>>,
    /// The number of partitions of the to vertex, if not provided, the default value is set to \"1\".
    #[serde(
        rename = "toVertexPartitionCount",
        skip_serializing_if = "Option::is_none"
    )]
    pub to_vertex_partition_count: Option<i32>,
    /// To vertex type.
    #[serde(rename = "toVertexType")]
    pub to_vertex_type: String,
}

impl CombinedEdge {
    /// CombinedEdge is a combination of Edge and some other properties such as vertex type, partitions, limits. It's used to decorate the fromEdges and toEdges of the generated Vertex objects, so that in the vertex pod, it knows the properties of the connected vertices, for example, how many partitioned buffers I should write to, what is the write buffer length, etc.
    pub fn new(
        from: String,
        from_vertex_type: String,
        to: String,
        to_vertex_type: String,
    ) -> CombinedEdge {
        CombinedEdge {
            conditions: None,
            from,
            from_vertex_limits: None,
            from_vertex_partition_count: None,
            from_vertex_type,
            on_full: None,
            to,
            to_vertex_limits: None,
            to_vertex_partition_count: None,
            to_vertex_type,
        }
    }
}
